home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / ChooseIcon & CustomFileName.cpt / ChooseIcon & CustomFileName / card_3568.txt < prev    next >
Text File  |  1989-02-26  |  8KB  |  360 lines

  1. -- card: 3568 from stack: in
  2. -- bmap block id: 2284
  3. -- flags: 0000
  4. -- background id: 2791
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on openCard
  8.   put "This is the 'Results' field." into card field "Results"
  9. end openCard
  10.  
  11.  
  12.  
  13. -- part 9 (button)
  14. -- low flags: 00
  15. -- high flags: 0000
  16. -- rect: left=29 top=43 right=62 bottom=236
  17. -- title width / last selected line: 0
  18. -- icon id / first selected line: 0 / 0
  19. -- text alignment: 1
  20. -- font id: 0
  21. -- text size: 12
  22. -- style flags: 0
  23. -- line height: 16
  24. -- part name: One
  25. ----- HyperTalk script -----
  26. on mouseUp
  27.   put ChooseIcon() into card field "Results"
  28. end mouseUp
  29.  
  30.  
  31.  
  32. -- part 10 (button)
  33. -- low flags: 00
  34. -- high flags: 0000
  35. -- rect: left=29 top=68 right=84 bottom=344
  36. -- title width / last selected line: 0
  37. -- icon id / first selected line: 0 / 0
  38. -- text alignment: 1
  39. -- font id: 0
  40. -- text size: 12
  41. -- style flags: 0
  42. -- line height: 16
  43. -- part name: Two
  44. ----- HyperTalk script -----
  45. on mouseUp
  46.   put ChooseIcon("Please choose an icon:") into card field "Results"
  47. end mouseUp
  48.  
  49.  
  50.  
  51. -- part 11 (button)
  52. -- low flags: 00
  53. -- high flags: 0000
  54. -- rect: left=29 top=92 right=110 bottom=486
  55. -- title width / last selected line: 0
  56. -- icon id / first selected line: 0 / 0
  57. -- text alignment: 1
  58. -- font id: 0
  59. -- text size: 12
  60. -- style flags: 0
  61. -- line height: 16
  62. -- part name: Three
  63. ----- HyperTalk script -----
  64. on mouseUp
  65.   put ChooseIcon("These are the icons in this stack, please select one:",1) into card field "Results"
  66. end mouseUp
  67.  
  68.  
  69.  
  70. -- part 12 (button)
  71. -- low flags: 00
  72. -- high flags: 0000
  73. -- rect: left=29 top=115 right=133 bottom=279
  74. -- title width / last selected line: 0
  75. -- icon id / first selected line: 0 / 0
  76. -- text alignment: 1
  77. -- font id: 0
  78. -- text size: 12
  79. -- style flags: 0
  80. -- line height: 16
  81. -- part name: Four
  82. ----- HyperTalk script -----
  83. on mouseUp
  84.   put CustomFileName() into card field "Results"
  85. end mouseUp
  86.  
  87.  
  88.  
  89. -- part 13 (button)
  90. -- low flags: 00
  91. -- high flags: 0000
  92. -- rect: left=29 top=140 right=156 bottom=290
  93. -- title width / last selected line: 0
  94. -- icon id / first selected line: 0 / 0
  95. -- text alignment: 1
  96. -- font id: 0
  97. -- text size: 12
  98. -- style flags: 0
  99. -- line height: 16
  100. -- part name: Five
  101. ----- HyperTalk script -----
  102. on mouseUp
  103.   put CustomFileName("STAK") into card field "Results"
  104. end mouseUp
  105.  
  106.  
  107.  
  108. -- part 14 (button)
  109. -- low flags: 00
  110. -- high flags: 0000
  111. -- rect: left=29 top=163 right=181 bottom=328
  112. -- title width / last selected line: 0
  113. -- icon id / first selected line: 0 / 0
  114. -- text alignment: 1
  115. -- font id: 0
  116. -- text size: 12
  117. -- style flags: 0
  118. -- line height: 16
  119. -- part name: Six
  120. ----- HyperTalk script -----
  121. on mouseUp
  122.   put line 1 of CustomFileName("STAK") into card field "Results"
  123. end mouseUp
  124.  
  125.  
  126.  
  127. -- part 15 (button)
  128. -- low flags: 00
  129. -- high flags: 0000
  130. -- rect: left=29 top=188 right=204 bottom=490
  131. -- title width / last selected line: 0
  132. -- icon id / first selected line: 0 / 0
  133. -- text alignment: 1
  134. -- font id: 0
  135. -- text size: 12
  136. -- style flags: 0
  137. -- line height: 16
  138. -- part name: Seven
  139. ----- HyperTalk script -----
  140. on mouseUp
  141.   put line 1 of CustomFileName("STAK","Please choose a HyperCard Stack:") into card field "Results"
  142. end mouseUp
  143.  
  144.  
  145.  
  146. -- part 16 (field)
  147. -- low flags: 01
  148. -- high flags: 2004
  149. -- rect: left=4 top=264 right=311 bottom=510
  150. -- title width / last selected line: 0
  151. -- icon id / first selected line: 0 / 0
  152. -- text alignment: 1
  153. -- font id: 3
  154. -- text size: 9
  155. -- style flags: 256
  156. -- line height: 12
  157. -- part name: Results
  158. ----- HyperTalk script -----
  159. on mouseUp
  160.   put empty into card field "Results"
  161. end mouseUp
  162.  
  163.  
  164.  
  165. -- part 26 (button)
  166. -- low flags: 00
  167. -- high flags: 0000
  168. -- rect: left=118 top=21 right=38 bottom=378
  169. -- title width / last selected line: 0
  170. -- icon id / first selected line: 0 / 0
  171. -- text alignment: 1
  172. -- font id: 0
  173. -- text size: 12
  174. -- style flags: 0
  175. -- line height: 16
  176. -- part name: Demo
  177. ----- HyperTalk script -----
  178. on mouseUp
  179.   show card field "Nahhhh..."
  180. end mouseUp
  181.  
  182.  
  183.  
  184. -- part 33 (button)
  185. -- low flags: 00
  186. -- high flags: 0000
  187. -- rect: left=243 top=311 right=340 bottom=279
  188. -- title width / last selected line: 0
  189. -- icon id / first selected line: 29114 / 29114
  190. -- text alignment: 1
  191. -- font id: 0
  192. -- text size: 12
  193. -- style flags: 0
  194. -- line height: 16
  195. -- part name: Return
  196. ----- HyperTalk script -----
  197. on mouseUp
  198.   visual effect iris close
  199.   go to first card
  200. end mouseUp
  201.  
  202.  
  203.  
  204. -- part 27 (field)
  205. -- low flags: 81
  206. -- high flags: 2004
  207. -- rect: left=5 top=24 right=337 bottom=507
  208. -- title width / last selected line: 0
  209. -- icon id / first selected line: 0 / 0
  210. -- text alignment: 1
  211. -- font id: 2
  212. -- text size: 24
  213. -- style flags: 22784
  214. -- line height: 32
  215. -- part name: Nahhhh...
  216. ----- HyperTalk script -----
  217. on mouseUp
  218.   hide card field "Nahhhh..."
  219. end mouseUp
  220.  
  221.  
  222.  
  223. -- part 48 (button)
  224. -- low flags: 00
  225. -- high flags: 0000
  226. -- rect: left=29 top=212 right=228 bottom=490
  227. -- title width / last selected line: 0
  228. -- icon id / first selected line: 0 / 0
  229. -- text alignment: 1
  230. -- font id: 0
  231. -- text size: 12
  232. -- style flags: 0
  233. -- line height: 16
  234. -- part name: Eight
  235. ----- HyperTalk script -----
  236. on mouseUp
  237.   put line 1 of CustomFileName("","Select any file:","Select/S") into card field "Results"
  238. end mouseUp
  239.  
  240.  
  241.  
  242. -- part 49 (button)
  243. -- low flags: 00
  244. -- high flags: A002
  245. -- rect: left=29 top=236 right=254 bottom=343
  246. -- title width / last selected line: 0
  247. -- icon id / first selected line: 0 / 0
  248. -- text alignment: 1
  249. -- font id: 0
  250. -- text size: 12
  251. -- style flags: 0
  252. -- line height: 16
  253. -- part name: Sample Button to Create a "Stack Button"
  254. ----- HyperTalk script -----
  255. on mouseUp
  256.   doMenu "New Button" -- Make a new button
  257.  
  258.   -- give it a name
  259.   ask "Please Name The Button:" with "My Stack Button"
  260.  
  261.   -- if you don't name it the forget the whole thing
  262.   if it is empty then
  263.     doMenu "Cut Button"
  264.     choose browse tool
  265.     exit mouseUp
  266.   end if
  267.  
  268.   put it into btnName
  269.  
  270.   -- Check for duplicates
  271.   repeat with i = 10 to the number of btns
  272.     if btnName is the short name of btn i then
  273.       answer "Button name already exists." with "Oh"
  274.       doMenu "Cut Button"
  275.       choose browse tool
  276.       exit mouseUp
  277.     end if
  278.   end repeat
  279.  
  280.   -- if you do name it
  281.  
  282.   set showName of btn "New Button" to false
  283.   set name of btn "New Button" to btnName
  284.  
  285.   -- make it bigger, etc.
  286.   set rect of btn btnName to 382,114,465,176
  287.   set style of btn btnName to rectangle
  288.   set autoHilite of btn btnName to true
  289.   set icon of btn btnName to 1020 -- a question mark in the interim
  290.   set showName of btn btnName to true
  291.  
  292.   -- Display Icons with the prompt string
  293.   put ChooseIcon("Please Choose An Icon For Your Button:") into myIcon
  294.  
  295.   -- if you cancel, then forget the whole thing
  296.   if myIcon is empty then
  297.     forgetIt btnName
  298.     exit mouseUp
  299.   end if
  300.  
  301.   -- if you don't cancel, then set the icon
  302.   set the icon of btn btnName to myIcon
  303.  
  304.  
  305.   -- get just the pathname of a selected stack, use prompt string
  306.   -- don't let user link button to this stack (or "go backs" will
  307.   -- leave stack
  308.  
  309.   put false into anotherStack
  310.   repeat until anotherStack
  311.  
  312.     put line 1 of CustomFileName("STAK","Please choose a stack to link to:") into whichStack
  313.     if whichStack is empty then
  314.       forgetIt btnName
  315.       exit mouseUp
  316.     end if
  317.  
  318.     if the short name of whichStack is not the short name of this stack then
  319.       put true into anotherStack
  320.     else
  321.       answer "Please choose a different stack." with "OK"
  322.     end if
  323.   end repeat
  324.  
  325.  
  326.   -- otherwise go to the selected stack if it's not this one
  327.   go to whichStack
  328.  
  329.   answer "Link Button To This Stack?" with "Cancel" or "OK"
  330.   if it contains "Cancel" then
  331.  
  332.     doMenu "Back"
  333.     forgetIt btnName
  334.     exit mouseUp
  335.   else
  336.     doMenu "Back"
  337.     put "on mouseUp"&return&"go to"&&whichStack&return&"end mouseUp"& return into myScript
  338.     set script of btn btnName to myScript
  339.   end if
  340.   answer "Congratulations, you have Succeeded" with "Splendid!"
  341.   choose browse tool
  342. end mouseUp
  343.  
  344. on forgetIt btnName
  345.   get location of btn btnName
  346.   click at it
  347.   doMenu "Cut Button"
  348.   choose Browse tool
  349. end forgetIt
  350.  
  351.  
  352. -- part contents for card part 27
  353. ----- text -----
  354.  
  355.  
  356. Nahhh...this one doesn't do anything!
  357.  
  358. -- part contents for card part 16
  359. ----- text -----
  360. This is the 'Results' field.